﻿using DHQGHN.DAL.DAO.DHQG;
using DHQGHN.DAL.Models.DHQG;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DHQGHN.DAL.BO.DHQG
{
    public class KeHoachBO : BaseBO
    {
        private KeHoachDAO _dao;
        public KeHoachBO()
        {
            _dao = new KeHoachDAO(Common.ConnectionUtil.DHQGHN_CONNECTION_STRING, DEFAULT_MAPPER_TYPE);
        }
        public bool Save(List<KeHoach> data)
        {
            try
            {
                return _dao.Save(data);
            }
            catch
            {
                throw;
            }
        }
        public List<GetBanChuaChot> Getbanchuachot(int namkh, int dv, int status)
        {
            try
            {
                return _dao.Getbanchuachot(namkh, dv, status);
            }
            catch
            {
                throw;
            }
        }
        public List<GIATRI> GetkehoachbyOption(int namkh, int chitieu, int donvi, int status)
        {
            try
            {
                return _dao.GetkehoachbyOption(namkh, chitieu, donvi, status);
            }
            catch
            {
                throw;
            }
        }
        public int UpdatekehoachbyOption(int namkh, int chitieu, int donvi, int status, string giatri)
        {
            try
            {
                return _dao.UpdatekehoachbyOption(namkh, chitieu, donvi, status, giatri);
            }
            catch
            {
                throw;
            }
        }
        public int AddChitieubyOption(int namkh, int chitieu, int donvi, string giatri, int ban)
        {
            try
            {
                return _dao.AddChitieubyOption(namkh, chitieu, donvi,giatri,ban);
            }
            catch
            {
                throw;
            }
        }
        public List<KeHoach> GetKehoachByNamKeHoach_NhomDV_NhomCT(int namkhid, int statusid, int flag, int nhomdonvi, int nhomchitieu)
        {
            try
            {
                return _dao.GetKehoachByNamKeHoach_NhomDV_NhomCT(namkhid, statusid, flag, nhomdonvi, nhomchitieu);
            }
            catch
            {
                throw;
            }
        }
        public int DeleteKehoachbyDVCT(int namkhid, int chitieu, int dv)
        {
            try
            {
               return _dao.DeleteKehoachbyDVCT(namkhid, chitieu, dv);
            }
            catch
            {
                throw;
            }
        }
        public List<KeHoach> GetKehoachByNamKeHoach(int namkhid, int statusid, int flag)
        {
            try
            {
                return _dao.GetKehoachByNamKeHoach(namkhid,statusid,flag);
            }
            catch
            {
                throw;
            }
        }
        public int ChotDieuChinhGiuanam(int namkh)
        {
            try
            {
                return _dao.ChotDieuChinhGiuanam(namkh);
            }
            catch
            {
                throw;
            }
        }
        public int Huychot(int namkh, int status, int donviid)
        {
            try
            {
                return _dao.Huychot(namkh, status, donviid);
            }
            catch
            {
                throw;
            }
        }
        public List<KeHoach> GetKhRiengbyDV(int namkh, int donviid, int status)
        {
            try
            {
                return _dao.GetKhRiengbyDV(namkh, donviid, status);
            }
            catch
            {
                throw;
            }
        }
        public List<KeHoach> GetbyDV(int namkh, int status, int dv)
        {
            try
            {
                return _dao.GetbyDV(namkh, status, dv);
            }
            catch
            {
                throw;
            }
        }
        public List<SUMCAP1> GetKehoach_CAP_1_ByNamKeHoach(int namkhid, int statusid)
        {
            try
            {
                return _dao.GetKehoach_CAP_1_ByNamKeHoach(namkhid, statusid);
            }
            catch
            {
                throw;
            }
        }
        public int DeleteKehoachbyNKH(int namkhid, int status, int nhomchitieu, int nhomdonvi)
        {
            try
            {
                return _dao.DeleteKehoachbyNKH(namkhid, status, nhomchitieu, nhomdonvi);
            }
            catch
            {
                throw;
            }
        }
        public List<SUMCANDOI> SumCanDOi(int namkhid, int statusid, int donvi)
        {
            try
            {
                return _dao.SumCanDOi(namkhid, statusid, donvi);
            }
            catch
            {
                throw;
            }
        }
        public int CheckUpdateDieuchinh(int namkhid, int status, int nhomchitieu, int nhomdonvi)
        {
            try
            {
                return _dao.CheckUpdateDieuchinh(namkhid, status, nhomchitieu, nhomdonvi);
            }
            catch
            {
                throw;
            }
        }
        public List<ListChiTieu> CheckPhanHoi(int namkh, int status, int donviid)
        {
            try
            {
                return _dao.CheckPhanHoi(namkh, status, donviid);
            }
            catch
            {
                throw;
            }
        }
        public int DeletePhanhoi(int namkhid, int status, int donviid, int nhomchitieu)
        {
            try
            {
                return _dao.DeletePhanhoi(namkhid, status, donviid, nhomchitieu);
            }
            catch
            {
                throw;
            }
        }
        public List<SumKH> GetSumKH(int namkhid, int statusid)
        {
            try
            {
                return _dao.GetSumKH(namkhid, statusid);
            }
            catch
            {
                throw;
            }
        }

        public List<SumKH> GetDieuChinhTheoMang(int namkhid)
        {
            try
            {
                return _dao.GetDieuChinhTheoMang(namkhid);
            }
            catch
            {
                throw;
            }
        }

        public List<SumKH> GetDieuChinhTheoDonVi(int namkhid, int donviid)
        {
            try
            {
                return _dao.GetDieuChinhTheoDonVi(namkhid, donviid);
            }
            catch
            {
                throw;
            }
        }

        public List<DIEU_CHINH_GIUA_NAM> GetDieuChinhDHQG(int namkhid, int statusid)
        {
            try
            {
                return _dao.GetDieuChinhDHQG(namkhid, statusid);
            }
            catch
            {
                throw;
            }
        }

        public List<DIEU_CHINH_GIUA_NAM> GetDieuChinhDHQG_ChuaCT(int namkhid)
        {
            try
            {
                return _dao.GetDieuChinhDHQG_ChuaCT(namkhid);
            }
            catch
            {
                throw;
            }
        }

        public List<DIEU_CHINH_GIUA_NAM> GetDieuChinhDonVi(int namkhid, int donviid)
        {
            try
            {
                return _dao.GetDieuChinhDonVi(namkhid, donviid);
            }
            catch
            {
                throw;
            }
        }

        public List<BC_DIEU_CHINH_GIUA_NAM> GetDieuChinhDonViChuaChinhThuc(int namkhid, int donviid)
        {
            try
            {
                return _dao.GetDieuChinhDonViChuaChinhThuc(namkhid, donviid);
            }
            catch
            {
                throw;
            }
        }

        public List<BC_DIEU_CHINH_GIUA_NAM> GetDieuChinhDonViChuaChinhThucAll(int namkhid, int donviid)
        {
            try
            {
                return _dao.GetDieuChinhDonViChuaChinhThucAll(namkhid, donviid);
            }
            catch
            {
                throw;
            }
        }

        public List<DIEU_CHINH_GIUA_NAM> GetTongHopDieuChinhDonVi(int namkhid, int donviid)
        {
            try
            {
                return _dao.GetTongHopDieuChinhDonVi(namkhid, donviid);
            }
            catch
            {
                throw;
            }
        }

        public List<DV_DIEU_CHINH> GetListDonViDieuChinh(int namkhid)
        {
            try
            {
                return _dao.GetListDonViDieuChinh(namkhid);
            }
            catch
            {
                throw;
            }
        }

        public List<BC_DIEU_CHINH_GIUA_NAM> GetDieuChinhDC03(int namkhid, int maChiTieuCap1)
        {
            try
            {
                return _dao.GetDieuChinhDC03(namkhid, maChiTieuCap1);
            }
            catch
            {
                throw;
            }
        }


        public double GetKhDHQGByChiTieu(int namkhid, int maChiTieu)
        {
            try
            {
                return _dao.GetKhDHQGByChiTieu(namkhid, maChiTieu);
            }
            catch
            {
                throw;
            }
        }
    }
}
